//************************************************************
//    > File Name: queue.cpp
//    > Author: davis
//    > Mail:  
//    > Created Time: 2017年03月23日 11:53:03
//***********************************************************

#include<bits/stdc++.h>
using namespace std;

int main(){
	queue<int> m1;
	for(int i=0;i<5;++i)
		m1.push(i);
	cout<<"m1.size is :"<<m1.size()<<" m1.front is "<<m1.front()<<" m1.back is "<<m1.back()<<endl;   //5 0 4 
	m1.pop();
	cout<<"after pop m1.size is :"<<m1.size()<<" m1.front is "<<m1.front()<<" m1.back is "<<m1.back()<<endl; //4 1 4
	int sum=0;
	while(!m1.empty()){
		sum += m1.front();
		m1.pop();
	}
	cout<<"sum is "<<sum<<endl; //10
	return 0;
}
